package todomanager.View;

import java.awt.Component;

import javax.swing.JCheckBox;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

public class CheckBoxCellRenderer implements TableCellRenderer{
	
	public Component getTableCellRendererComponent(	JTable table,
	Object value, boolean isSelected,boolean isFocused, int row, int col) {
		boolean marked = (Boolean) value;
		JCheckBox rendererComponent = new JCheckBox();
		if (marked) {
				rendererComponent.setSelected(true);
				table.setValueAt((Integer)100, row, 6);
		}
		if( !marked && isSelected && isFocused){
			table.setValueAt((Integer)0, row, 6);
		}
		
		
		table.repaint();
		return rendererComponent;
	}

}
